.class public Lrexsee/flash/RexseeFlash;
.super Ljava/lang/Object;
.source "RexseeFlash.java"

# interfaces
.implements Lrexsee/core/browser/clazz/JavascriptInterface;


# static fields
.field public static final EVENT_ONFLASHDIALOGDISMISSED:Ljava/lang/String; = "onFlashDialogDismissed"

.field public static final FLASHPLAYER_PACKAGE_NAME:Ljava/lang/String; = "com.adobe.flashplayer"

.field public static final INTERFACE_NAME:Ljava/lang/String; = "Flash"


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;

.field private mFlashDialog:Lrexsee/flash/FlashDialog;

.field private mLeftKeyboard:Lrexsee/flash/FlashKeyboardParameters;

.field private mRightKeyboard:Lrexsee/flash/FlashKeyboardParameters;

.field private mSwfStyle:Ljava/lang/String;


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 2
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    const/4 v0, 0x0

    .line 41
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 36
    iput-object v0, p0, Lrexsee/flash/RexseeFlash;->mFlashDialog:Lrexsee/flash/FlashDialog;

    .line 37
    iput-object v0, p0, Lrexsee/flash/RexseeFlash;->mLeftKeyboard:Lrexsee/flash/FlashKeyboardParameters;

    .line 38
    iput-object v0, p0, Lrexsee/flash/RexseeFlash;->mRightKeyboard:Lrexsee/flash/FlashKeyboardParameters;

    .line 39
    const-string v0, ""

    iput-object v0, p0, Lrexsee/flash/RexseeFlash;->mSwfStyle:Ljava/lang/String;

    .line 42
    iput-object p1, p0, Lrexsee/flash/RexseeFlash;->mBrowser:Lrexsee/core/browser/Browser;

    .line 43
    iget-object v0, p1, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onFlashDialogDismissed"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 44
    return-void
.end method

.method static synthetic access$0(Lrexsee/flash/RexseeFlash;)Lrexsee/flash/FlashDialog;
    .locals 1

    .prologue
    .line 36
    iget-object v0, p0, Lrexsee/flash/RexseeFlash;->mFlashDialog:Lrexsee/flash/FlashDialog;

    return-object v0
.end method


# virtual methods
.method public clearKeyboard()V
    .locals 1

    .prologue
    const/4 v0, 0x0

    .line 108
    iput-object v0, p0, Lrexsee/flash/RexseeFlash;->mLeftKeyboard:Lrexsee/flash/FlashKeyboardParameters;

    .line 109
    iput-object v0, p0, Lrexsee/flash/RexseeFlash;->mRightKeyboard:Lrexsee/flash/FlashKeyboardParameters;

    .line 110
    return-void
.end method

.method public clearLeftKeyboard()V
    .locals 1

    .prologue
    .line 102
    const/4 v0, 0x0

    iput-object v0, p0, Lrexsee/flash/RexseeFlash;->mLeftKeyboard:Lrexsee/flash/FlashKeyboardParameters;

    .line 103
    return-void
.end method

.method public clearRightKeyboard()V
    .locals 1

    .prologue
    .line 105
    const/4 v0, 0x0

    iput-object v0, p0, Lrexsee/flash/RexseeFlash;->mRightKeyboard:Lrexsee/flash/FlashKeyboardParameters;

    .line 106
    return-void
.end method

.method public dismiss()V
    .locals 1

    .prologue
    .line 85
    iget-object v0, p0, Lrexsee/flash/RexseeFlash;->mFlashDialog:Lrexsee/flash/FlashDialog;

    if-eqz v0, :cond_0

    .line 86
    iget-object v0, p0, Lrexsee/flash/RexseeFlash;->mFlashDialog:Lrexsee/flash/FlashDialog;

    invoke-virtual {v0}, Lrexsee/flash/FlashDialog;->dismiss()V

    .line 87
    const/4 v0, 0x0

    iput-object v0, p0, Lrexsee/flash/RexseeFlash;->mFlashDialog:Lrexsee/flash/FlashDialog;

    .line 89
    :cond_0
    return-void
.end method

.method public getInheritInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 24
    return-object p0
.end method

.method public getInterfaceName()Ljava/lang/String;
    .locals 2

    .prologue
    .line 20
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lrexsee/flash/RexseeFlash;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v1, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v1, v1, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "Flash"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getNewInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 28
    return-object p0
.end method

.method public getVersionCode()I
    .locals 6

    .prologue
    const/4 v5, -0x1

    .line 57
    sget-object v3, Landroid/os/Build$VERSION;->SDK:Ljava/lang/String;

    invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v3

    const/16 v4, 0x8

    if-ge v3, v4, :cond_0

    move v3, v5

    .line 65
    :goto_0
    return v3

    .line 58
    :cond_0
    iget-object v3, p0, Lrexsee/flash/RexseeFlash;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {v3}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v2

    .line 61
    .local v2, "pm":Landroid/content/pm/PackageManager;
    :try_start_0
    const-string v3, "com.adobe.flashplayer"

    const/4 v4, 0x0

    invoke-virtual {v2, v3, v4}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
    :try_end_0
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    .line 65
    .local v1, "pi":Landroid/content/pm/PackageInfo;
    if-nez v1, :cond_1

    move v3, v5

    goto :goto_0

    .line 62
    .end local v1    # "pi":Landroid/content/pm/PackageInfo;
    :catch_0
    move-exception v3

    move-object v0, v3

    .local v0, "e":Landroid/content/pm/PackageManager$NameNotFoundException;
    move v3, v5

    .line 63
    goto :goto_0

    .line 65
    .end local v0    # "e":Landroid/content/pm/PackageManager$NameNotFoundException;
    .restart local v1    # "pi":Landroid/content/pm/PackageInfo;
    :cond_1
    iget v3, v1, Landroid/content/pm/PackageInfo;->versionCode:I

    goto :goto_0
.end method

.method public getVersionName()Ljava/lang/String;
    .locals 6

    .prologue
    const-string v5, ""

    .line 68
    sget-object v3, Landroid/os/Build$VERSION;->SDK:Ljava/lang/String;

    invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v3

    const/16 v4, 0x8

    if-ge v3, v4, :cond_0

    const-string v3, ""

    move-object v3, v5

    .line 76
    :goto_0
    return-object v3

    .line 69
    :cond_0
    iget-object v3, p0, Lrexsee/flash/RexseeFlash;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {v3}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v2

    .line 72
    .local v2, "pm":Landroid/content/pm/PackageManager;
    :try_start_0
    const-string v3, "com.adobe.flashplayer"

    const/4 v4, 0x0

    invoke-virtual {v2, v3, v4}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
    :try_end_0
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    .line 76
    .local v1, "pi":Landroid/content/pm/PackageInfo;
    if-nez v1, :cond_1

    const-string v3, ""

    move-object v3, v5

    goto :goto_0

    .line 73
    .end local v1    # "pi":Landroid/content/pm/PackageInfo;
    :catch_0
    move-exception v3

    move-object v0, v3

    .line 74
    .local v0, "e":Landroid/content/pm/PackageManager$NameNotFoundException;
    const-string v3, ""

    move-object v3, v5

    goto :goto_0

    .line 76
    .end local v0    # "e":Landroid/content/pm/PackageManager$NameNotFoundException;
    .restart local v1    # "pi":Landroid/content/pm/PackageInfo;
    :cond_1
    iget-object v3, v1, Landroid/content/pm/PackageInfo;->versionName:Ljava/lang/String;

    goto :goto_0
.end method

.method public isReady()Z
    .locals 6

    .prologue
    const/4 v5, 0x0

    .line 47
    sget-object v3, Landroid/os/Build$VERSION;->SDK:Ljava/lang/String;

    invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v3

    const/16 v4, 0x8

    if-ge v3, v4, :cond_0

    move v3, v5

    .line 54
    .end local p0    # "this":Lrexsee/flash/RexseeFlash;
    :goto_0
    return v3

    .line 48
    .restart local p0    # "this":Lrexsee/flash/RexseeFlash;
    :cond_0
    iget-object v3, p0, Lrexsee/flash/RexseeFlash;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {v3}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v2

    .line 49
    .local v2, "pm":Landroid/content/pm/PackageManager;
    invoke-virtual {v2, v5}, Landroid/content/pm/PackageManager;->getInstalledApplications(I)Ljava/util/List;

    move-result-object v0

    .line 50
    .local v0, "ais":Ljava/util/List;, "Ljava/util/List<Landroid/content/pm/ApplicationInfo;>;"
    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .line 51
    .end local p0    # "this":Lrexsee/flash/RexseeFlash;
    .local v1, "iterator":Ljava/util/Iterator;, "Ljava/util/Iterator<Landroid/content/pm/ApplicationInfo;>;"
    :cond_1
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-nez v3, :cond_2

    move v3, v5

    .line 54
    goto :goto_0

    .line 52
    :cond_2
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Landroid/content/pm/ApplicationInfo;

    iget-object v3, p0, Landroid/content/pm/ApplicationInfo;->packageName:Ljava/lang/String;

    const-string v4, "com.adobe.flashplayer"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_1

    const/4 v3, 0x1

    goto :goto_0
.end method

.method public keyDown(I)V
    .locals 1
    .param p1, "keyCode"    # I

    .prologue
    .line 113
    iget-object v0, p0, Lrexsee/flash/RexseeFlash;->mFlashDialog:Lrexsee/flash/FlashDialog;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lrexsee/flash/RexseeFlash;->mFlashDialog:Lrexsee/flash/FlashDialog;

    invoke-virtual {v0, p1}, Lrexsee/flash/FlashDialog;->keyDown(I)V

    .line 114
    :cond_0
    return-void
.end method

.method public keyDownUp(II)V
    .locals 4
    .param p1, "keyCode"    # I
    .param p2, "duration"    # I

    .prologue
    .line 119
    iget-object v0, p0, Lrexsee/flash/RexseeFlash;->mFlashDialog:Lrexsee/flash/FlashDialog;

    if-eqz v0, :cond_0

    .line 120
    iget-object v0, p0, Lrexsee/flash/RexseeFlash;->mFlashDialog:Lrexsee/flash/FlashDialog;

    invoke-virtual {v0, p1}, Lrexsee/flash/FlashDialog;->keyDown(I)V

    .line 121
    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    new-instance v1, Lrexsee/flash/RexseeFlash$1;

    invoke-direct {v1, p0, p1}, Lrexsee/flash/RexseeFlash$1;-><init>(Lrexsee/flash/RexseeFlash;I)V

    .line 126
    int-to-long v2, p2

    .line 121
    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    .line 128
    :cond_0
    return-void
.end method

.method public keyUp(I)V
    .locals 1
    .param p1, "keyCode"    # I

    .prologue
    .line 116
    iget-object v0, p0, Lrexsee/flash/RexseeFlash;->mFlashDialog:Lrexsee/flash/FlashDialog;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lrexsee/flash/RexseeFlash;->mFlashDialog:Lrexsee/flash/FlashDialog;

    invoke-virtual {v0, p1}, Lrexsee/flash/FlashDialog;->keyUp(I)V

    .line 117
    :cond_0
    return-void
.end method

.method public setLeftKeyboard(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 7
    .param p1, "keysString"    # Ljava/lang/String;
    .param p2, "keyTheme"    # Ljava/lang/String;
    .param p3, "boardStyle"    # Ljava/lang/String;
    .param p4, "rowStyle"    # Ljava/lang/String;
    .param p5, "normalStyle"    # Ljava/lang/String;
    .param p6, "pressedStyle"    # Ljava/lang/String;

    .prologue
    .line 95
    new-instance v0, Lrexsee/flash/FlashKeyboardParameters;

    move-object v1, p1

    move-object v2, p2

    move-object v3, p3

    move-object v4, p4

    move-object v5, p5

    move-object v6, p6

    invoke-direct/range {v0 .. v6}, Lrexsee/flash/FlashKeyboardParameters;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    iput-object v0, p0, Lrexsee/flash/RexseeFlash;->mLeftKeyboard:Lrexsee/flash/FlashKeyboardParameters;

    .line 96
    return-void
.end method

.method public setRightKeyboard(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 7
    .param p1, "keysString"    # Ljava/lang/String;
    .param p2, "keyTheme"    # Ljava/lang/String;
    .param p3, "boardStyle"    # Ljava/lang/String;
    .param p4, "rowStyle"    # Ljava/lang/String;
    .param p5, "normalStyle"    # Ljava/lang/String;
    .param p6, "pressedStyle"    # Ljava/lang/String;

    .prologue
    .line 98
    new-instance v0, Lrexsee/flash/FlashKeyboardParameters;

    move-object v1, p1

    move-object v2, p2

    move-object v3, p3

    move-object v4, p4

    move-object v5, p5

    move-object v6, p6

    invoke-direct/range {v0 .. v6}, Lrexsee/flash/FlashKeyboardParameters;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    iput-object v0, p0, Lrexsee/flash/RexseeFlash;->mRightKeyboard:Lrexsee/flash/FlashKeyboardParameters;

    .line 99
    return-void
.end method

.method public setSwfStyle(Ljava/lang/String;)V
    .locals 0
    .param p1, "style"    # Ljava/lang/String;

    .prologue
    .line 92
    iput-object p1, p0, Lrexsee/flash/RexseeFlash;->mSwfStyle:Ljava/lang/String;

    .line 93
    return-void
.end method

.method public show(Ljava/lang/String;Ljava/lang/String;)V
    .locals 8
    .param p1, "swf"    # Ljava/lang/String;
    .param p2, "style"    # Ljava/lang/String;

    .prologue
    .line 80
    invoke-virtual {p0}, Lrexsee/flash/RexseeFlash;->dismiss()V

    .line 81
    new-instance v0, Lrexsee/flash/FlashDialog;

    iget-object v1, p0, Lrexsee/flash/RexseeFlash;->mBrowser:Lrexsee/core/browser/Browser;

    const-string v2, "RexseeFlashDialog"

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "window-dim-amount:0;window-modeless:true;border-width:0px;alpha:1;width:100%;height:100%;"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    iget-object v4, p0, Lrexsee/flash/RexseeFlash;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v4, v4, Lrexsee/core/browser/Browser;->urlListeners:Lrexsee/core/browser/RexseeUrl;

    invoke-virtual {v4, p1}, Lrexsee/core/browser/RexseeUrl;->getAbsoluteUrl(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    iget-object v5, p0, Lrexsee/flash/RexseeFlash;->mSwfStyle:Ljava/lang/String;

    iget-object v6, p0, Lrexsee/flash/RexseeFlash;->mLeftKeyboard:Lrexsee/flash/FlashKeyboardParameters;

    iget-object v7, p0, Lrexsee/flash/RexseeFlash;->mRightKeyboard:Lrexsee/flash/FlashKeyboardParameters;

    invoke-direct/range {v0 .. v7}, Lrexsee/flash/FlashDialog;-><init>(Lrexsee/core/browser/Browser;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lrexsee/flash/FlashKeyboardParameters;Lrexsee/flash/FlashKeyboardParameters;)V

    iput-object v0, p0, Lrexsee/flash/RexseeFlash;->mFlashDialog:Lrexsee/flash/FlashDialog;

    .line 82
    iget-object v0, p0, Lrexsee/flash/RexseeFlash;->mFlashDialog:Lrexsee/flash/FlashDialog;

    invoke-virtual {v0}, Lrexsee/flash/FlashDialog;->start()V

    .line 83
    return-void
.end method
